# -*- coding:utf-8 -*-
class Student(object):
    def __init__(self, name, score):
        self.__name = name
        self.__score = score

    def __init__(self):
        pass

    def printScore(self):
        print('name:', self.__name, self.__score)


class Animal(object):
    def run(self):
        print('Animal is running')


class Dog(Animal):
    def run(self):
        print('Dog is running')


class Cat(Animal):
    def run(self):
        print('cat is running')


if __name__ == '__main__':
    # s = Student('zhang san', 18)
    # s.printScore()
    # print(s._Student__name)
    # Dog().run()
    # Cat().run()
    # print(type(123))
    # print(type(s))
    # print(type(Dog()))
    a = Animal()
    d = Dog()
    s = Student()
    print(isinstance(d, Animal))
    print(isinstance(s, Animal))
    print(dir(d))
    a.aa = '123'
    print(a.aa)
    # print(d.aa)
    print(hasattr(d, 'aa'))
    print(getattr(d, 'aa', 404))
    r = getattr(a, 'run')
    print(r)
    r()
